package com.money.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 订单
 *
 * @author 小🌤
 * @email 1578442339@qq.com
 * @date 2021-12-29 21:06:27
 */
@Data
@TableName("cbb_order")
public class CbbOrderEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 订单编号
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String orUuid;
    /**
     * 充值的账号
     */
    private String orNumber;
    /**
     * 用户名称
     */
    private String orName;
    /**
     * 下单时间
     */
    private Date orCreateTime;
    /**
     * 商品名称
     */
    private String orSpName;
    /**
     * 下单数量
     */
    private Integer orCount;
    /**
     * 支付价格
     */
    private Double orPlayPrice;
    /**
     * 支付时间
     */
    private Date orPlayTime;
    /**
     * 支付状态（0未支付,1进行中，2已完成，-1支付取消）
     */
    private Integer orStatus;

    /**
     * 状态
     */
    @TableField(exist = false)
    private String orStatusString;


    public String getOrStatusString() {
        switch (orStatus) {
            case 0:
                orStatusString = "未支付";
                break;
            case 1:
                orStatusString = "进行中";
                break;
            case 2:
                orStatusString = "已完成";
                break;
            case -1:
                orStatusString = "已取消";
                break;
        }
        return orStatusString;
    }

    /**
     * 手机号
     */
    private long orPhone;
    /**
     * 商品id
     */
    private Long orStId;

    /**
     * 用户id
     */
    private Integer orUrId;

    /**
     * 支付类型
     */
    private String orType;

    public CbbOrderEntity(String orUuid, String orNumber, String orName, String orSpName, Integer orCount, Double orPlayPrice, Integer orStatus, long orPhone, Integer orUrId, String orType,Long spId) {
        this.orUuid = orUuid;
        this.orNumber = orNumber;
        this.orName = orName;
        this.orSpName = orSpName;
        this.orCount = orCount;
        this.orPlayPrice = orPlayPrice;
        this.orStatus = orStatus;
        this.orPhone = orPhone;
        this.orUrId = orUrId;
        this.orType = orType;
        this.orStId=spId;
    }
}
